//package com.indicator;
//
//import org.springframework.boot.actuate.health.*;
//import org.springframework.stereotype.Component;
//
//import java.util.HashMap;
//import java.util.Iterator;
//import java.util.Map;
//import java.util.Set;
//import java.util.stream.Stream;
//
//@Component
//public class ServiceHealthIndicator implements CompositeHealthContributor {
//
//    private Map<String, HealthContributor> contributors = new HashMap<>();
//
//    public ServiceHealthIndicator(ServiceAHealthIndicator a, ServiceBHealthIndicator b){
//        contributors.put("Service A", a);
//        contributors.put("Service b", b);
//    }
//
//    @Override
//    public HealthContributor getContributor(String name) {
//        return contributors.get(name);
//    }
//
//    @Override
//    public Iterator<NamedContributor<HealthContributor>> iterator() {
//        //contributors.entrySet().stream().map()
//        //Set<Map.Entry<String, HealthContributor>> entries = contributors.entrySet();
//        //Stream<Map.Entry<String, HealthContributor>> stream = entries.stream();
//        //stream.map()
//        return contributors.entrySet().stream()
//                .map((entry) -> NamedContributor.of(entry.getKey(), entry.getValue())).iterator();
//    }
//}
